<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			/*a:first-child {
				color: red;
			}*/
			/*同类型的第一个元素*/
			p:first-of-type {  
				color: red;
			}
		</style>
	</head>

	<body>
		<div class="test">
			<a href="#">测试</a> 
			<p>p标签</p>
			<a href="">测试</a>
			<p>p标签</p>
			<p>p标签</p>
			<a href="#">a标签</a>
			<a href="#">a标签</a>
		</div>

	</body>

</html>